package com.demo.fieldunique;

import cn.lingyangwl.framework.mybatis.mate.annotations.FieldUnique;
import cn.lingyangwl.framework.mybatis.mate.annotations.FieldUniqueConfig;
import cn.lingyangwl.framework.mybatis.mate.enums.SqlConditionTypeEnum;
import cn.lingyangwl.framework.mybatis.mate.inter.EntityFieldUniqueCheck;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

/**
 * @author shenguangyang
 */
@Data
@TableName("field_unique_01")
@FieldUniqueConfig(sqlCondition = SqlConditionTypeEnum.AND, tableId = "id", entityId = "id")
public class FieldUniquePO01 implements EntityFieldUniqueCheck {
    /** 字典编码 */
    @TableId(type = IdType.AUTO)
    private Integer id;

    @FieldUnique(message = "name01重复")
    private String name01;

    @FieldUnique(message = "name02重复")
    private String name02;

    /**
     * 有没有被删除, 1 删除, 0没有被删除
     */
    @FieldUnique(condition = FieldUnique.Condition.NE, value = "1")
    private String hasDelete;
}
